<?php
class menuMod
{
	/**
	 * @var mysqlPdo
	 */
	private $db;
	private $table;
	
	function __construct()
	{
		$this->db=wsModel::getInstance();
		$this->table='menu';
	}
	
	public function getMenuList($menuId=FALSE,$depth=6)
	{
		$menuId=$menuId ?$menuId :0;
		return $this->db->selectData($this->table,array('parentId'=>$menuId),'menuSort desc,menuId asc');;
	}
	
	public function addMenu($data)
	{
		if(!is_array($data))
		{
			return false;
		}
		return $this->db->insertData($this->table, $data);
	}
	
	public function getMenuInfo($menuId)
	{
		if($menuId)
		{
			return $this->db->findData($this->table,array('menuId'=>$menuId));
		}
		return FALSE;
	}
}